<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCruiseCheckTasksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_check_tasks', function (Blueprint $table) {
            $table->id();
            $table->string('name', 32)->default('')->comment('巡检名称');
            $table->unsignedInteger('startTime')->default(0)->comment('任务开始时间');
            $table->unsignedInteger('endTime')->default(0)->comment('任务结束时间');
            $table->unsignedInteger('templateId')->default(0)->comment('巡检模板id');
            $table->unsignedInteger('status')->default(0)->comment('1待推送 2执行中 3已完成 4已作废');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '稽核 - 巡检任务';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cruise_check_tasks');
    }
}
